#!/bin/bash

if [ -z $1 ]; then
  echo "all.sh: Give a verilog module name to do or a command..."
  exit
fi

if [ $1 == "clean" ]; then
  echo "all.sh: Cleaning files..."
  rm $(ls | grep .*~$)
  if [ -f dump.vcd ]; then
    rm dump.vcd
  fi
  exit
fi

cd vpi && make && cd .. && ./compile $1 && ./run $1 && ./wave $1
